﻿using System;
using System.Collections.Generic;
using Fortune.Attributes.API;

namespace Fortune.API
{
    /// <summary>
    /// 获取游戏账户相关信息
    /// </summary>
    [Get("/account")]
    public class AccountApi : AbstractApi<string>
    {
        protected override object handle(string param)
        {
            AccountData dataAccount = GameMain.data.account;
            return new List<Dictionary<string, object>>
            {
                new Dictionary<string, object>
                {
                    // 用户名
                    ["userName"] = dataAccount.userName,
                    // 用户ID
                    ["userId"] = dataAccount.userId,
                    // 平台
                    ["platform"] = Enum.GetName(typeof(ESalePlatform), dataAccount.platform)
                }
            };
        }
    }
}